﻿/*
 *  Source code courtesy of the desktopWeb.CodePlex.com community project. See MS-PL license on Codeplex.com. 
 *  This is beta code not intended for a production application.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.ComponentModel;
using MyData.SharePoint;

namespace MyData.Activities
{
  [Designer(typeof(MyData.Activities.SharePointBaseDesigner))]
  public sealed class SharePointPermissions : CodeActivity<Boolean>
  {
    public OutArgument<bool> FullControl { get; set; }

    protected override bool Execute(CodeActivityContext context)
    {
      Permissions p = new Permissions();

      //Example uses CanManage as FullControl permissions
      FullControl.Set(context, p.CurrentUser.CanManage);

      //Production application would return status
      return true;
    }
  }
}
